package com.retoc.graduationtravel.controller;

import com.retoc.graduationtravel.common.ApiRestResponse;
import com.retoc.graduationtravel.domain.Banner;
import com.retoc.graduationtravel.service.BannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/banner")
@RestController
public class BannerController {

    @Autowired
    BannerService bannerService;

    @GetMapping("/list")
    public ApiRestResponse<List<Banner>> getBanner() {
        List<Banner> list = bannerService.list();
        return ApiRestResponse.success(list);
    }
}
